function [x,y,z] = drawOrbit_new(a, e, i, Omega, omega)
%% 返回空间轨道椭圆的点集（X(1)为近地点坐标） 
% a                 半长轴
% e     [0,1)       偏心率
% i     [0,pi]      轨道倾角
% Omega [0,2*pi)    升交点赤经
% omega [0,2*pi)    近地点张角（幅角）

global precision 
theta = 0:precision:2*pi;
rho = a*(1-e^2)./(1+e*cos(theta));
[x,y] = pol2cart(theta,rho);
z = zeros(1,length(x));

% 坐标系变换
M1 = makehgtform('zrotate',Omega);
M2 = makehgtform('xrotate',i);
M3 = makehgtform('zrotate',omega);
% 春分点惯性坐标系Si -> 节点坐标系Sn
Lni = M2'*M1';
Lni = Lni(1:3,1:3);
% 节点坐标系Sn -> 拱线坐标系Sp
Lpn = M3';
Lpn = Lpn(1:3,1:3);

% Lpn*Lni*{u}_i = {u}_p
tmp = (Lpn*Lni)'*[x;y;z];
x = tmp(1,:);
y = tmp(2,:);
z = tmp(3,:);
    
plot3([x x(1)],[y y(1)],[z z(1)],'Color',[0.4660 0.6740 0.1880]);

end